var { expressjwt } = require('express-jwt')
const config  = require('./config')

module.exports = expressjwt({
      secret: config.secret_key,
      algorithms: ["HS256"],
      getToken: (req)=>{
        console.log('check token' + req.url);
        if(req.headers['x-token']){
            return req.headers['x-token']
        }
        return null;
      }
    })